package com.news.gpb.controller;

import com.news.gpb.dao.UserDao;
import com.news.gpb.entity.User;
import com.news.gpb.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin("http://localhost:8080")
@RestController
public class EditController {

    @Autowired
    UserService userService;

    @RequestMapping("edit")
    String editUser(@RequestBody User user)
    {
        return userService.editUser(user);
    }
}
